﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using RouterControl.Web;
using RouterControl.Whs;

namespace RouterControl.WhsAddIn.Wizards.SelectRouter.FeatureTests
{
    internal sealed class FeatureTestPortForwarding : FeatureTest
    {
        public FeatureTestPortForwarding(CommonInternetGateway dev, UsageInfo.RouterInfo info)
            : base(dev, info, "Port Forwarding")
        {
        }

        public override DiagResult Run()
        {
            try
            {
                _dev.GetPortForwardings();

                _info.SupportsPortForwarding = true;

                return DiagResult.Success;

            }
            catch
            {
                _info.SupportsPortForwarding = false;
                
                throw;
            }
        }
    }
}